using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableReturnReason
	{
		public const string Table = "ReturnReason";
		public const string ReturnReasonID = "ReturnReasonID";
		public const string OrdersID = "OrdersID";
		public const string ReasonTypeID = "ReasonTypeID";
		public const string Reason = "Reason";
		public const string Creater = "Creater";
		public const string CreatedBy = "CreatedBy";
		public const string Created = "Created";
		public const string Modified = "Modified";
		public const string ModifiedBy = "ModifiedBy";
		public const string ModifiedByID = "ModifiedByID";
	}
	
	[Serializable]
	public class BaseReturnReason
		: IDbSessionEntity, IJsonClass
	{
		int m_ReturnReasonID;
		/// <summary>
        /// 退订原因表ID
        /// </summary>
        public int ReturnReasonID
        {
            get { return m_ReturnReasonID; }
            set { m_ReturnReasonID = value; }
        }
		
		int m_OrdersID;
		/// <summary>
        /// 订单表ID
        /// </summary>
        public int OrdersID
        {
            get { return m_OrdersID; }
            set { m_OrdersID = value; }
        }
		
		int m_ReasonTypeID;
		/// <summary>
        /// 原因类型（退订原因，不同意退订原因）
        /// </summary>
        public int ReasonTypeID
        {
            get { return m_ReasonTypeID; }
            set { m_ReasonTypeID = value; }
        }
		
		string m_Reason;
		/// <summary>
        /// 退订原因
        /// </summary>
        public string Reason
        {
            get { return m_Reason; }
            set { m_Reason = value; }
        }
		
		int m_Creater;
		/// <summary>
        /// 创建人ID
        /// </summary>
        public int Creater
        {
            get { return m_Creater; }
            set { m_Creater = value; }
        }
		
		string m_CreatedBy;
		/// <summary>
        /// 创建人名称
        /// </summary>
        public string CreatedBy
        {
            get { return m_CreatedBy; }
            set { m_CreatedBy = value; }
        }
		
		DateTime m_Created;
		/// <summary>
        /// 创建时间
        /// </summary>
        public DateTime Created
        {
            get { return m_Created; }
            set { m_Created = value; }
        }
		
		DateTime m_Modified;
		/// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime Modified
        {
            get { return m_Modified; }
            set { m_Modified = value; }
        }
		
		string m_ModifiedBy;
		/// <summary>
        /// 修改人
        /// </summary>
        public string ModifiedBy
        {
            get { return m_ModifiedBy; }
            set { m_ModifiedBy = value; }
        }
		
		int? m_ModifiedByID;
		/// <summary>
        /// 修改人ID
        /// </summary>
        public int? ModifiedByID
        {
            get { return m_ModifiedByID; }
            set { m_ModifiedByID = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_ReturnReasonID = reader[TableReturnReason.ReturnReasonID];
            m_OrdersID = reader[TableReturnReason.OrdersID];
            m_ReasonTypeID = reader[TableReturnReason.ReasonTypeID];
            m_Reason = reader[TableReturnReason.Reason];
            m_Creater = reader[TableReturnReason.Creater];
            m_CreatedBy = reader[TableReturnReason.CreatedBy];
            m_Created = reader[TableReturnReason.Created];
            m_Modified = reader[TableReturnReason.Modified];
            m_ModifiedBy = reader[TableReturnReason.ModifiedBy];
            m_ModifiedByID = reader[TableReturnReason.ModifiedByID];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableReturnReason.ReturnReasonID, PrimaryKeyType.Identity, ReturnReasonID);
			writer[TableReturnReason.OrdersID] = OrdersID;
			writer[TableReturnReason.ReasonTypeID] = ReasonTypeID;
			writer[TableReturnReason.Reason] = Reason;
			writer[TableReturnReason.Creater] = Creater;
			writer[TableReturnReason.CreatedBy] = CreatedBy;
			writer[TableReturnReason.Created] = Created;
			writer[TableReturnReason.Modified] = Modified;
			writer[TableReturnReason.ModifiedBy] = ModifiedBy;
			writer[TableReturnReason.ModifiedByID] = ModifiedByID;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_ReturnReasonID = idd;
        }
		
		public string TableName
        {
            get { return TableReturnReason.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_ReturnReasonID = hashToRead["ReturnReasonID"];
			 
             m_OrdersID = hashToRead["OrdersID"];
			 
             m_ReasonTypeID = hashToRead["ReasonTypeID"];
			 
             m_Reason = hashToRead["Reason"];
			 
             m_Creater = hashToRead["Creater"];
			 
             m_CreatedBy = hashToRead["CreatedBy"];
			 
             m_Created = hashToRead["Created"];
			 
             m_Modified = hashToRead["Modified"];
			 
             m_ModifiedBy = hashToRead["ModifiedBy"];
			 
             m_ModifiedByID = hashToRead["ModifiedByID"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["ReturnReasonID"] = ReturnReasonID;
			 
            hashToFill["OrdersID"] = OrdersID;
			 
            hashToFill["ReasonTypeID"] = ReasonTypeID;
			 
            hashToFill["Reason"] = Reason;
			 
            hashToFill["Creater"] = Creater;
			 
            hashToFill["CreatedBy"] = CreatedBy;
			 
            hashToFill["Created"] = Created;
			 
            hashToFill["Modified"] = Modified;
			 
            hashToFill["ModifiedBy"] = ModifiedBy;
			 
            hashToFill["ModifiedByID"] = ModifiedByID;
			 
        }

        #endregion
		
	}
}
